package com.songlanyun.modules.message.service.impl;


import com.songlanyun.common.utils.custom.ClassConvertUtils;
import com.songlanyun.modules.message.model.to.MessageTO;
import com.songlanyun.modules.rabbitmq.MqConstant;
import com.songlanyun.modules.message.service.SendPrivateMessageMsgService;
import com.songlanyun.modules.rabbitmq.service.SendMsgService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 发送站内消息
 */
@Service("sendPrivateMessageMsgService")
public class SendPrivateMessageMsgServiceImpl implements SendPrivateMessageMsgService {

    @Resource
    private SendMsgService sendMsgService;

    @Override
    public void send(MessageTO to) {
        sendMsgService.sendCommon(MqConstant.PrivateMessageSendMessageConstant.PRIVATE_MESSAGE_SEND_MESSAGE_EXCHANGE,
                MqConstant.PrivateMessageSendMessageConstant.PRIVATE_MESSAGE_SEND_MESSAGE_ROUTER
                , ClassConvertUtils.transformJSONToSnake(to));

    }
}
